<template>
  <div class="scrollbar">
    <el-scrollbar>
      <el-form label-position="top" :model="selectTable" ref="addForm" label-width="200px" :inline="false" autocomplete="off">
        <el-row :gutter="20">
          <el-col style="text-align:center;">
            <b>审核记录</b>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="info">
          <el-col :span="8">
            {{selectTable.authType === '2' ? '机构名称':'分析师名称'}}：{{selectTable.nickname}}
          </el-col>
          <el-col :span="8">
            {{selectTable.authType === '2' ? '机构法人':'真实姓名'}}：{{selectTable.names}}
          </el-col>
          <el-col :span="8">
            手机：{{selectTable.phone}}
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col>
            <el-table v-loading="!pload" ref="multipleTable" border :data="tableData" size="mini">
              <el-table-column label="序号" width="100" align="center" show-overflow-tooltip>
                <template slot-scope="scope">
                  {{scope.$index + 1}}
                </template>
              </el-table-column>
              <el-table-column label="审核时间" show-overflow-tooltip>
                <template slot-scope="scope">
                  {{scope.row.createTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}
                </template>
              </el-table-column>
              <el-table-column label="结果" show-overflow-tooltip>
                <template slot-scope="scope">
                  {{{'1':'待审核','5':'审核不通过','10':'审核成功'}[scope.row.result]}}
                </template>
              </el-table-column>
              <el-table-column property="reason" label="原因" show-overflow-tooltip></el-table-column>
              <el-table-column property="auditor" label="审核帐户" show-overflow-tooltip></el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </el-form>
    </el-scrollbar>
    <div class="footer">
      <el-button @click="$emit('close')">关 闭</el-button>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.scrollbar {
  height: 100%;
  overflow: hidden;
  padding-bottom: 50px;
  position: relative;
  .el-scrollbar {
    height: 100%;
  }
  .el-row {
    margin-bottom: 20px;
    border-bottom: 1px #e4e4e4 solid;
    padding-bottom: 20px;
  }
  .el-form {
    padding: 20px;
  }
  .info {
    font-size: 14px;
    color: #666;
    .el-col {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
  .title {
    text-align: center;
    font-size: 16px;
    border-bottom: 1px #e4e4e4 solid;
    padding-bottom: 15px;
    margin-bottom: 15px;
  }
  .footer {
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
  }
}
</style>
<script>
import * as api from '@/utils/api'
export default {
  props: {
    data: Object
  },
  created() {
    this.selectTable = this.JSONs(this.data)
    this.getData()
  },
  watch: {
    show(newVal) {
      this.$emit('close')
    }
  },
  computed: {
    title() {
      if (this.id) {
        return '修改'
      } else {
        return '添加'
      }
    }
  },
  data() {
    return {
      pload: false,
      rule: [
        { required: true, message: '必填项', trigger: 'change' }
      ],
      show: true,
      selectTable: {},
      tableData: []
    }
  },
  methods: {
    async getData() {
      this.pload = false
      const Datas = await api.getLtsAuditCertHistory({
        id: this.selectTable.id
      })
      this.tableData = Datas.list
    }
  }
}
</script>